$(function(){
	// 百度地图API功能
	var map = new BMap.Map("allmap");            
	var point = new BMap.Point(120.61883,30.057694);
	map.centerAndZoom(point,12);
	function myFun(result){
		var cityName = result.name;
		map.setCenter(cityName);
		// alert("当前定位城市:"+cityName);
	}
	var myCity = new BMap.LocalCity();
	myCity.get(myFun);
	// 鼠标缩放
	map.enableScrollWheelZoom(true);           
	//单击获取点击的经纬度
	map.addEventListener("click",function(e){
		// alert(e.point.lng + "," + e.point.lat);
		$("#lng").attr("value",e.point.lng);
		$("#lng").text(e.point.lng);
		$("#lat").attr("value",e.point.lat);
		$("#lat").text(e.point.lat);
		layer.msg("已将坐标插入表单",{time:600});
		layer.close(index);
	});
})